From: Matthieu Gallien Date: Wed, 7 May 2025 12:37:43 +0000 (+0200) Subject: fix(readonly): enable MOVE rollback when folder is read-only X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1^2~13^2~1^2~27^2 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=985a0a766bd1e8facbf49d3abf4b69bf82a623f9;p=nextcloud-desktop.git fix(readonly): enable MOVE rollback when folder is read-only Signed-off-by: Matthieu Gallien --- diff --git a/src/libsync/propagateremotemove.cpp b/src/libsync/propagateremotemove.cpp index 34c172bd3..63078c697 100644 --- a/src/libsync/propagateremotemove.cpp +++ b/src/libsync/propagateremotemove.cpp @@ -209,7 +209,9 @@ void PropagateRemoteMove::slotMoveJobFinished() &propagator()->_anotherSyncNeeded); const auto filePath = propagator()->fullLocalPath(_item->_renameTarget); const auto filePathOriginal = propagator()->fullLocalPath(_item->_originalFile); + const auto oldFile = QFileInfo{filePathOriginal}; QFile file(filePath); + auto permissionsHandler = FileSystem::FilePermissionsRestore{oldFile.absolutePath(), FileSystem::FolderPermissions::ReadWrite}; if (!file.rename(filePathOriginal)) { qCWarning(lcPropagateRemoteMove) << "Could not MOVE file" << filePathOriginal << " to" << filePath << " with error:" << _job->errorString() << " and failed to restore it !";